<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/js3/jQuery-2.1.4/jquery-2.1.4.min.js"></script>
    <script>
        $(function () {
            $('#login').click(function () {
                var name=$('#username').val();
                var word=$('#password').val();
                $.post('/login2.do',{username:name,password:word},function (data) {
                    $('#result').html(data.msg).css('color',data.success?'green':'red');
                })

            })
        })
    </script>
</head>
<body>
<span id="result"></span>
<input type="text" id="username" name="username" placeholder="用户名">
<input type="text" id="password" name="password" placeholder="密码">
<button id="login">登录</button>
</body>
</html>